package com.qiaofang.applet.service.property.service.impl;
import java.util.Date;

import com.qiaofang.applet.common.base.MongoBaseService;
import com.qiaofang.applet.common.context.QfContextHolder;
import com.qiaofang.applet.service.property.domain.PropertyRoles;
import com.qiaofang.applet.service.property.domain.PropertyVideo;
import com.qiaofang.applet.service.property.repository.PropertyRolesRepository;
import com.qiaofang.applet.service.property.repository.PropertyVideoRepository;
import com.qiaofang.applet.service.property.service.PropertyRolesService;
import com.qiaofang.applet.service.property.service.PropertyVideoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class PropertyRolesServiceImpl extends MongoBaseService<PropertyRoles, String> implements PropertyRolesService {

    private final PropertyRolesRepository repository;

    public PropertyRolesServiceImpl(PropertyRolesRepository repository) {
        super(repository);
        this.repository = repository;
    }

    @Override
    public PropertyRoles findByPropertyUuidAndCompanyUuid(String propertyUuid, String companyUuid) {
        return repository.findFirstByPropertyUuidAndCompanyUuidOrderByUpdateTimeDesc(propertyUuid, companyUuid);
    }
}
